﻿namespace iFinance.Infrastructure.ViewModels
{
    using iFinance.Entity;
    using Microsoft.Practices.Prism.ViewModel;

    /// <summary>
    /// 消费品ViewModel
    /// </summary>
    public class ConsumableViewModel : NotificationObject
    {
        #region Ctor

        public ConsumableViewModel()
        {
            //TODO TestData
            List.Add(new ConsumableItemViewModel(
               new Consumable
               {
                   ID = 1,
                   LastUnitPrice = 0.6m,
                   Name = "肉包",
               }));

            List.Add(new ConsumableItemViewModel(
               new Consumable
               {
                   ID = 2,
                   LastUnitPrice = 10.2m,
                   Name = "康师傅红烧牛肉面5包装",
               }));

            List.Add(new ConsumableItemViewModel(
                new Consumable
                {
                    ID = 3,
                    LastUnitPrice = 1.99m,
                    Name = "香蕉",
                }));
        }

        #endregion

        #region 属性

        private ConsumableListViewModel list = new ConsumableListViewModel();

        /// <summary>
        /// 消费品列表
        /// </summary>
        public ConsumableListViewModel List
        {
            get { return this.list; }
            set
            {
                if (this.list != value)
                {
                    this.list = value;
                    RaisePropertyChanged(() => this.List);
                }
            }
        }

        #endregion
    }
}
